package com.mida.dms.knw.api;

import com.mida.dms.knw.entity.KnwConceptualDetail;
import com.mida.dms.knw.entity.vo.KnwConceptualDetailVo;
import com.mida.dms.knw.vo.PageResultVo;
import com.mida.tool.common.result.ActionResult;
import com.mida.tool.common.result.ListResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.DependsOn;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Description: 概念描述Fegin接口
 * @Author: wang xiao le
 * @Date: 2021/6/21 15:24
 **/
@DependsOn("loadFromDatabasePropertyConfig")
//@FeignClient(name = "knwConceptualDetailApi", url = "${dms.knw.feign.url}")
@FeignClient(name = "knwConceptualDetailApi", url = "dms.knw.feign.url")
public interface KnwConceptualDetailApi {
    /**
     * 1、新增概念描述
     *
     */
    @PostMapping(value = "/knwConceptualDetail/addKnwConceptualDetail", produces = {"application/json;charset=UTF-8"})
    @ResponseBody
    ActionResult add(@RequestParam(value = "conceptualSoid") Long conceptualSoid,
                     @RequestParam(value = "conceptualDetailSoid") Long conceptualDetailSoid,
                     @RequestParam(value = "conceptualDetailName") String conceptualDetailName,
                     @RequestParam(value = "isPreferred") Long isPreferred,
                     @RequestParam(value = "languageSoid") Long languageSoid,
                     @RequestParam(value = "conceptualDetailType") Long conceptualDetailType,
                     @RequestParam(value = "status") Long status);
//    ActionResult add(KnwConceptualDetail t);

    /**
     * 2、更新概念描述
     */

    @PostMapping(value = "/knwConceptualDetail/updateKnwConceptualDetail", produces = {"application/json;charset=UTF-8"})
    @ResponseBody
    ActionResult update(@RequestParam(value = "conceptualSoid") Long conceptualSoid,
                        @RequestParam(value = "conceptualDetailSoid") Long conceptualDetailSoid,
                        @RequestParam(value = "conceptualDetailName") String conceptualDetailName,
                        @RequestParam(value = "isPreferred") Long isPreferred,
                        @RequestParam(value = "languageSoid") Long languageSoid,
                        @RequestParam(value = "conceptualDetailType") Long conceptualDetailType,
                        @RequestParam(value = "status") Long status);
//    ActionResult update(KnwConceptualDetail t);

    /**
     * 3、删除概念描述
     */

    @GetMapping(value = "/knwConceptualDetail/deleteKnwConceptualDetail")
    @ResponseBody
    ActionResult delete(@RequestParam(value = "soid") long soid);

    /**
     * 4、 获取概念描述
     */

    @GetMapping(value = "/knwConceptualDetail/getKnwConceptualDetail")
    @ResponseBody
    ListResult<KnwConceptualDetail> get(@RequestParam(value = "soid") long soid);

    /**
     * 5、分页查询概念描述
     */

    @PostMapping(value = "/knwConceptualDetail/findPage", produces = {"application/json;charset=UTF-8"})
    @ResponseBody
    ListResult<PageResultVo<KnwConceptualDetailVo>> findPage(@RequestParam(value = "currentPage") Long currentPage,
                                                             @RequestParam(value = "pageSize") Long pageSize,
                                                             @RequestParam(value = "searChData") String searChData,
                                                             @RequestParam(value = "conceptualSoid") Long conceptualSoid);
//    ListResult<PageResultVo<KnwConceptualDetailVo>> findPage(KnwConceptualDetailPageVo vo);

    /**
     * 6、检查名称
     */
    @GetMapping(value = "/knwConceptualDetail/checkName")
    @ResponseBody
    ActionResult checkName(@RequestParam(value = "soid") Long soid,
                           @RequestParam(value = "name") String name);

    /**
     * 7、设置概念描述首选
     */

    @GetMapping(value = "/knwConceptualDetail/setFirst")
    @ResponseBody
    ActionResult setFirst(@RequestParam(value = "soid")  Long soid,
                          @RequestParam(value = "conceptualSoid") Long conceptualSoid,
                          @RequestParam(value = "isConceptualDomain") Long isConceptualDomain);
}
